<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="box"></div>
    <script>
      //   let json = `{"name":789,"age":888}`;
      //   console.log(json);
      //   json = JSON.parse(json,function(){

      //   });
      //   console.log(JSON.stringify(json));
      //   console.log(json.age);
      //   const jsonString = '{"name":"Tom","birthday":"2000-01-023"}';
      //   const person = JSON.parse(jsonString, function (key, value) {
      //     if (key === "birthday") {
      //       return new Date(value);
      //     }
      //     return value;
      //   });
      //   console.log(person.birthday.getDate());

      const person = {
        name: "Tom",
        age: undefined,
        gender: "male",
      };
      const jsonString = JSON.stringify(person, ["name", "gender"], 2);
      console.log(jsonString);
    </script>
  </body>
</html>
